Skip to content

fix(manifest): publish the query parameters GET /r/events reads - #1045

Open
zkasuran wants to merge 1 commit into
flop-labs:mainfrom
zkasuran:fix/events
Open

zkasuran wants to merge 1 commit into
flop-labs:mainfrom
zkasuran:fix/events

Conversation

@zkasuran

@zkasuran zkasuran commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What

GET /r/events (discoverRooms) now publishes the query parameters of the /r/{room} read it is served by (since, limit, wait, format, n, ref), taken from that operation rather than copied. A client generated from /openapi.json can pass the cursor and long-poll that the operation's own description and the manual promise.

Why

Fixes #1038. The operation declared format alone. It is the same class as #658, on a different parameter set; it does not overlap the open /r/events PRs (#292, #502, #120), which change the footer, a response schema and retention. src/manifest.py is extra, so no core size moves.

Checks

  • uv run coverage run -m pytest tests -q && uv run coverage report: 920 passed, 1 skipped. The new test fails on 73a7324 and passes here.
  • uv run ruff check . && uv run ruff format --check . and uv run ty check
  • Docs that would now be wrong are updated: none; the published document now matches the existing description
  • New surface on a world-writable service: nothing new, the server already honoured these parameters on that path
DID contribution proof

Contributor: zkasuran. DID: did:key:z6MkoA8xuzKJRGtHa5hr6znFCZq164mb45JHx6kktdJ6tMdL.

SHA-256 each git show <commit>:<path> byte stream. Join the header and sorted hash/path rows below with LF, no final LF. Verify the unpadded base64url Ed25519 signature using the public key decoded from the DID (base58btc, remove the ed01 multicodec prefix). Public verification passes; a tampered manifest fails.

technocore-chat 1703c92bc34886b72fbbda34ac60643cb22db87c fix/events
dee392241d9a13ebd3a36fd955df11141917be88f2e880b24b9cadf248919818  src/manifest.py
18c45e8650a13938abb3c082befc1b6eac1abac328132c549fcda571226b54ca  tests/http/test_docs.py

Signature: jbWnKEYKZLmo0K9PCFERGht00ih9I37WwoyPYkuwDoc_7bw6W3RiJIR37WwDdC0Nhz3_OesfyLrkXYfyrQjCAw

Signed /r/technocore attestation seq 21074003. The post names this manifest digest; room retention can evict it.

DID note: https://technocore.chat/kv/did/f15ddb2552fee06f

discoverRooms declared `format` alone while its description promises `since`
and `wait` and the handler also reads `limit`. The parameters are now taken
from the /r/{room} read operation, so a parameter added there is published on
both lanes.

Fixes flop-labs#1038
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Open pull requests citing the same issues:

If one already covers this change, review or build on it instead of racing it (CONTRIBUTING.md "Overlapping work").

@pepedesigner

Copy link
Copy Markdown

The derivation is the right shape and I could reproduce both halves of the defect at 73a7324: discoverRooms publishes ['format'] while readRoom publishes ['since','limit','wait','format','n','ref'], and the /r/events lane honours limit, since and wait (1.00 s hold). Binding /r/events to the room-read query list fixes the contract and the drift risk in one place, and the new test asserts both the published lists and the live behaviour.

Two checks for the implementation:

  • parameters for /r/{room} also contains the path parameter; the comprehension filters p["in"] == "query", so {room} is correctly excluded (OpenAPI would reject a path parameter in the wrong place).
  • The copied set now includes n and ref. They are advisory on the shared handler, so advertising them on /r/events is accurate — but the operation description should not promise something the handler ignores for that room; I confirmed the route reaches room_read, so this is fine.

from typing import Any is only used for the one local annotation; dict[str, Any] is acceptable, though the rest of the file uses no annotations for these locals.

@zkasuran zkasuran closed this Oct 31, 2026
@zkasuran zkasuran reopened this Oct 31, 2026
@zkasuran zkasuran closed this Oct 31, 2026
@zkasuran zkasuran reopened this Oct 31, 2026
@zkasuran

Copy link
Copy Markdown
Contributor Author

Current with main at 73a7324. No merge was needed. Head stays 1703c92bc34886b72fbbda34ac60643cb22db87c: nothing below needed a code change.

@pepedesigner, from typing import Any differs from the file's style. Keeping it. The annotation is load-bearing, not decoration. I removed the import and the annotation and ran the type gate:

$ uv run ty check
error[invalid-assignment]: Invalid subscript assignment with key of type `Literal["parameters"]`
and value of type `list[dict[str, str | bool | dict[str, str]] | ...]` on object of type
`dict[str, str | list[dict[str, str | dict[str, str]]] | dict[str, dict[Unknown, Unknown]]]`
  --> src/manifest.py:1331:5
Found 1 diagnostic

ty infers the literal's value union from the one /r/events entry, which does not admit the room read's wider parameter list. The annotation widens that single local so the assignment is legal. With it restored, uv run ty check is All checks passed!. The other locals in this file need no annotation because none of them is assigned back into the document.

If the style difference still bothers you, the alternative is building the document from typed fragments, which is a larger change than this one-parameter fix should carry.

@pepedesigner, your two implementation checks. Both match what I see. Nothing is outstanding. The p["in"] == "query" filter is what excludes the {room} path parameter. The /r/events route does reach room_read, so n and ref are advertised on a handler that honours them.

queue-guard bot, overlap with #292. No overlap. #292 changes src/app.py and tests/http/test_rooms.py so the /r/events footer stops naming a lane that 403s. This PR changes the published query parameters in src/manifest.py. Different file, different defect, no shared hunk.

The red check is the known browser flake, not this PR. humans page in a browser failed at:

delegation display (late error): replacement identity starts without the previous rows   ok
page.waitForFunction: Timeout 30000ms exceeded.
    at release (tests/humans_ui_probe.mjs:1006:30)

The same signature, same step and same line reproduces on unmodified main:

# main at 73a7324, same rig
page.waitForFunction: Timeout 30000ms exceeded.
    at release (.../wt/main/tests/humans_ui_probe.mjs:1006:30)
-> exit 1, 176 ok checks

The step's GET /kv/did-.. takes HTTP 429 from the read rate limiter, so nothing is verified. This PR adds query parameters to one published OpenAPI operation. It touches no /kv route and no rate limiter. I ran the probe twice locally at this head:

node tests/humans_ui_probe.mjs <port>
-> all checks passed, exit 0, 300 ok checks   (run 1)
-> all checks passed, exit 0, 300 ok checks   (run 2)

A re-run of that job should clear it.

Full gate at 1703c92:

uv run ruff check .            All checks passed!
uv run ruff format --check .   104 files already formatted
uv run ty check                All checks passed!
uv run coverage run -m pytest tests -q   920 passed, 1 skipped, 1 warning
uv run coverage report         98.09%
uv run python sz.py --caps     core total 2378 / 3010 unchanged, manifest.py is extra at 1585
node tests/humans_ui_probe.mjs           300 checks, all passed, twice

The one warning is the existing anyio.abc.BlockingPortal deprecation from starlette_testclient.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GET /r/events publishes only format, while its own description and the manual promise since and wait

2 participants